package com.itheima.mapper;

import com.itheima.entity.Clazz;
import com.itheima.entity.ClazzQueryParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper {

    /**
     * 分页查询
     * @param clazzParam
     * @return
     */
    List<Clazz> selectByPage(ClazzQueryParam clazzParam);

    void save(Clazz clazz);

    /**
     * 查询所有班级
     * @return
     */
    @Select("select * from clazz")
    List<Clazz> list();

    /**
     * 查询班级信息
     * @param id
     * @return
     */
    @Select("select * from clazz where id=#{id}")
    Clazz getById(Integer id);

    /**
     * 更新班级信息
     * @param clazz
     */

    void update(Clazz clazz);

    /**
     * 删除班级
     * @param id
     */
    @Delete("delete from clazz where id=#{id}")
    void delete(Integer id);
}
